﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />


<!DOCTYPE html>
<html lang="zh-CN">
<head>

<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ihg-theme-draft">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <jsp:include page="/WEB-INF/include/submenu-session.jsp">
    <jsp:param name="currentUrl" value="${ctx.host}/sessions/${session.id}" />
  </jsp:include>

  <div class="container-fluid ihg-container has-ihg-sidemenu">

    <div class="ihg-breadcrumb">
      <ol class="breadcrumb border-breadcrumb">
        <li class="active">Coaching Progress</li>
      </ol>
    </div>

    <div class="ihg-content-layout">
      <div class="ihg-operation-bar no-margin no-bottom-border clearfix">
        <div class="ihg-operation-group pull-right">
          <a href="${ctx.host}/sessions/${session.id}/admin-coaching-progress/search" class="btn btn-success btn-shadow btn-shadow-success" data-target="#search" data-toggle="modal">Search</a>
        </div>
      </div>

      <table class="table table-striped ihg-table tab-pane">
        <thead>
          <tr>
            <th>DELEGATE NAME</th>
            <th>COACHING CONVERSATION</th>
            <th>COACH</th>
            <th>EMAIL OF DELEGATE</th>
            <th>EMAIL OF COACH</th>
            <th>DATE</th>
            <th>OPT</th>
          </tr>
        </thead>
        <tbody>
          <c:forEach var="delegate" items="${delegates}">
            <tr>
              <td>${delegate.name}</td>
              <td>${empty conversationAmount[delegate.idString]['finish'] ? '0' : conversationAmount[delegate.idString]['finish']} out of ${empty conversationAmount[delegate.idString]['total'] ? '0' : conversationAmount[delegate.idString]['total']} complete</td>
              <td>
                <c:choose>
                  <c:when test="${not empty attributes[delegate.idString]['delegate-coach']}">${persist.admin(attributes[delegate.idString]['delegate-coach'].value).email}</c:when>
                  <c:otherwise>-</c:otherwise>
                </c:choose>
              </td>
              <td>${delegate.email}</td>
              <td>
                <c:choose>
                  <c:when test="${not empty attributes[delegate.idString]['delegate-coach']}">${persist.admin(attributes[delegate.idString]['delegate-coach'].value).email}</c:when>
                  <c:otherwise>-</c:otherwise>
                </c:choose>
              </td>
              <td><fmt:formatDate value="${session.coachStartDate}" pattern="yyyy-MM-dd"/>~<fmt:formatDate value="${session.coachEndDate}" pattern="yyyy-MM-dd"/></td>
              <td>
                <c:if test="${empty attributes[delegate.idString]['delegate-coach']}">
                  <a href="${ctx.host}/sessions/${session.id}/admin-coaching-progress/delegates/${delegate.id}/bind-exist-coach" class="btn btn-link" data-target="#bind-coach" data-toggle="modal">EXIST COACH</a>
                  <a href="${ctx.host}/sessions/${session.id}/admin-coaching-progress/delegates/${delegate.id}/bind-new-coach" class="btn btn-link" data-target="#bind-coach" data-toggle="modal">NEW COACH</a>
                </c:if>
                <a href="${ctx.host}/sessions/${session.id}/admin-coaching-progress/delegates/${delegate.id}" class="btn btn-link">VIEW</a>
              </td>
            </tr>
          </c:forEach>
        </tbody>
      </table>
    </div>


  </div>

  <%@ include file="/WEB-INF/include/footer.jsp"%>
  <%@ include file="/WEB-INF/include/script.jsp"%>


  <d:resource root="${ctx.resource}/build" type="script" src="js/page/session/coaching-progress-list.js" />
  <script type="text/javascript">
    require([ 'page/session/coaching-progress-list' ], function(page) {
      page.init();
    })
  </script>
</body>

</html>
